package com.ck.ips.controller.program;

import com.ck.common.model.OperationResult;
import com.ck.core.annotation.LoginRequired;
import com.ck.core.constant.PageConstant;
import com.ck.ips.service.program.ProgramLogService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author linqiang
 * @version v1.0
 * @Description 节目日志
 * @date 2019-05-07 17:24
 */
@LoginRequired
@RestController
@RequestMapping(value = "programLog")
public class ProgramLogController {

    @Autowired
    private ProgramLogService programLogService;

    /**
     * 分页列表
     *
     * @param programVersion 节目版本号
     * @param pageNum        当前页
     * @param pageSize       每页条数
     * @return OperationResult
     */
    @PostMapping(value = "list")
    public OperationResult list(String programVersion, Integer pageNum, Integer pageSize) {
        pageNum = (pageNum == null ? PageConstant.DEFAULT_PAGE_NUM : pageNum);
        pageSize = (pageSize == null ? PageConstant.DEFAULT_PAGE_SIZE : pageSize);
        return programLogService.listByPage(programVersion, pageNum, pageSize);
    }
}
